package com.ruoyi.order.domain.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel(description = "微信支付请求参数")
public class WeChatPayRequest implements Serializable {

    @ApiModelProperty(value = "微信应用ID", example = "微信应用ID")
    private String appid;

    @ApiModelProperty(value = "商户号", example = "商户号")
    @JsonProperty("mchid")
    private String mchId;

    @ApiModelProperty(value = "商品描述", example = "商品描述")
    private String description;

    @ApiModelProperty(value = "商户订单号", example = "商户订单号")
    @JsonProperty("out_trade_no")
    private String outTradeNo;

    @ApiModelProperty(value = "通知回调地址", example = "通知回调地址")
    @JsonProperty("notify_url")
    private String notifyUrl;

    @ApiModelProperty(value = "支付金额信息", example = "支付金额信息")
    private WeChatPayAmountRequest amount;

    @ApiModelProperty(value = "支付用户信息", example = "支付用户信息")
    private WeChatPayPayerRequest payer;

    @Data
    @ApiModel(description = "支付金额信息")
    public static class WeChatPayAmountRequest {

        @ApiModelProperty(value = "订单总金额（单位：分）", example = "订单总金额（单位：分）")
        private Integer total;
    }

    @Data
    @ApiModel(description = "支付用户信息")
    public static class WeChatPayPayerRequest {

        @ApiModelProperty(value = "微信用户openid", example = "微信用户openid")
        @JsonProperty("openid")
        private String openId;
    }
}
